package main

import (
	"fmt"
	"time"
)


/*
const (
Nanosecond Duration = 1
Microsecond = 1000 * Nanosecond
Millisecond = 1000 * Microsecond
Second = 1000 * Millisecond
Minute = 60 * Second
Hour = 60 * Minute

*/

func getDateUint32() uint32{
	return (time.Now().Year() % 100 )* 10000 + time.Now().Month()  * 100 + time.Now().Day()  
}

func getDateStr() string{
	fmt.Sprinf("%08d", getDateUint32())
}

func getTimeUint32() uint32{
	return (time.Now().Hour() % 100 )* 10000 + time.Now().Minute()  * 100 + time.Now().Second()  
}
func getTimeStr() string{
	fmt.Sprinf("%08d", getTimeUint32())
}

func main() {
	timestamp1 := time.Now().Unix() 
	timestamp2 := time.Now().UnixNano()
	utcstr:=time.Now().UTC() 
	time.Local = time.FixedZone("CST", 3600*8)
	BJstr:=time.Now().Local()
	fmt.Println("time stamp1:\t", timestamp1)
	fmt.Println("time stamp2:\t", timestamp2)
	fmt.Println("utc time:\t",utcstr)
	fmt.Println("beijing time:\t",BJstr)
	
	

    for true{
		t1:=time.Now().Year()        //年
		t2:=time.Now().Month()       //月
		t3:=time.Now().Day()         //日
		t4:=time.Now().Hour()        //小时
		t5:=time.Now().Minute()      //分钟
		t6:=time.Now().Second()      //秒
		fmt.Printf("%d-%d-%d %d:%d:%d\n", t1, t2, t3, t4, t5, t6)
		time.Sleep(1000*time.Millisecond)
    }

}


